package com.cheers.dao;

import java.math.BigDecimal;
import java.util.List;

public interface BaseDao {
	
	public Object save(Object obj) throws Exception ;
	public <T> T load(Class<T> entityClass, Object entityId) throws Exception;
	public <T> T get(Class<T> entityClass, Object entityId) throws Exception;

	public void remove(Object obj) throws Exception ;

	public <T> T findByHql(Class<T> entityClass, String hql, Object objs[]) throws Exception ;
	
	public <T> T findBySql(Class<T> entityClass, String sql, Object[] params) throws Exception;
	
	public <T> List<T> findListBySql(Class<T> entityClass, String sql, Object[] params) throws Exception;
	
	public <T> List<T> findBySql(Class<T> entityClass, int firstindex, int maxresult, String sql, Object[] params) throws Exception;
	
	public List findBySql(int firstindex, int maxresult, String sql, Object[] params) throws Exception;
	
	public List findBySql(String sql, Object[] params) throws Exception;
	
	public int getCount(String sql, Object[] params) throws Exception;
	
	public BigDecimal getSum(String sql, Object[] params) throws Exception;

	public Long executeUpdate(String hql, Object params[]) throws Exception ;
	
}
